//
//  YCHomePageController.m
//  美丽衣橱
//
//  Created by 方赫 on 16/4/18.
//  Copyright © 2016年 FH. All rights reserved.
//

#import "YCHomePageController.h"
#import "YCHomeNavLeftButton.h"

@interface YCHomePageController ()

@end

@implementation YCHomePageController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    // 1. 配置navigationBar
    [self setUpNavigationBar];

}

- (void)setUpNavigationBar {
    
    // 1. titleView
    UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"home_page_titleimage"]];
    self.navigationItem.titleView = imageView;
    
    // 2. leftButton
    YCHomeNavLeftButton *btn = [YCHomeNavLeftButton loadLeftButton];
    [btn addTarget:self action:@selector(pushToJoinInView) forControlEvents:UIControlEventTouchUpInside];
    
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:btn];

    // 3. rightButton
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageWithOriginRenderMode:@"home_page_title_search"] style:UIBarButtonItemStyleDone target:self action:@selector(pushToSearchView)];
}

/** 跳转到加盟页面 */
- (void)pushToJoinInView {
    NSLog(@"我要加盟");
}

/** 跳转到搜索页面 */
- (void)pushToSearchView {
    NSLog(@"跳转到搜索页面");
}



@end
